import java.util.Scanner;
public class old_neq {
    public static int client(int den, int num) {
        int ratio = 0;
        if (den <= 0 || num <= 0) {
            ratio = 0;
        } else if (den > 0 && num < 16) {
            if (num < 8) {
                int dtemp = den, ntemp = num;
                int countd = 0, countn = 0;

                while (dtemp > 0) {
                    countd += 1;
                    dtemp /= 10;
                }
                while (ntemp > 0) {
                    countn += 1;
                    ntemp /= 10;
                }
                int max = 1, min = 1;
                if (countd > countn) {
                    for (int t1 = 1; t1 <= countd; t1++)
                        max *= 10;
                    for (int t2 = 1; t2 <= countn; t2++)
                        min *= 10;
                } else {
                    for (int t1 = 1; t1 <= countd; t1++)
                        min *= 10;
                    for (int t2 = 1; t2 <= countn; t2++)
                        max *= 10;
                }
                ratio = max;
            } else {
                while (num < 16) {
                    ratio += 1;
                    num++;
                }
                ratio = num;
            }
            ratio = den;
        } else {
            if (den < 0)
                den = -den;
            num = 256;
            while (num > 0) {
                ratio = ratio + 1;
                num--;
            }
            ratio = -1;
        }
        return ratio;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int den = scanner.nextInt();
        int num = scanner.nextInt();

        int ratio = 0, flag = -1;
        if (num > 16 && num < 32) {
            ratio = client(den, num / 2);
            flag = 1;
        } else {
            ratio = client(den, num);
            flag = 2;
        }
        System.out.printf("\n%d, %d\n", ratio, flag);

        System.exit(0);
    }
}
